num = input()
arr = list(map(int, input().split()))
arrMin = arr[0]
for i in arr:
    if arrMin > i:
        arrMin = i
print(arrMin)